package apollo.generator.common.utils;

import apollo.generator.modules.entity.SysUserEntity;
import org.apache.shiro.SecurityUtils;

/**
 * <Description>
 * 登录工具类
 * @author Jun Lee
 * @version 1.0
 * @createDate 2020/07/03 17:40
 * @see apollo.generator.common.utils
 */
public class LoginUtils {
    public static SysUserEntity getUser() {
        return (SysUserEntity) SecurityUtils.getSubject().getPrincipal();
    }

    public static Long getUserId() {
        return getUser().getUserId();
    }
}
